/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proyecto2;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

/**
 *
 * @author damian
 */
public class Campo extends JPanel{
    int celdas_h,celdas_v;
    String[] letras={"A","B","C","D","E","F","G","H","I","J","K"};
    public Campo(int celdas_h, int celdas_v) {
        this.celdas_h = celdas_h;
        this.celdas_v = celdas_v;
        GridBagConstraints cnt;
        this.setLayout(new GridBagLayout());
        String key;
        int k=0;
        for (int i = 0; i < celdas_v; i++) {
            for (int j = 0; j < celdas_h; j++) {

                cnt = new GridBagConstraints();
                cnt.gridx = j;
                cnt.gridy = i;
                cnt.ipadx = 2;
                cnt.ipady = 2;
                
                    key = letras[i] + (new Integer(j)).toString();
                    this.add(new JLabel(key), cnt);
//                    this.add(listasiento.get(k).lbl, cnt);
//                    listasiento.get(k).lbl.addMouseListener(new MouseAdapter() {
//                        @Override
//                        public void mouseClicked(MouseEvent e) {
//                            System.out.println("clic");
//                        }
//                    });
                    k++;
                }
            }
        }
    }
    

